#pragma once

struct iAS {
    int score;
    uint idx;
    __host__ __device__
    bool operator<(const iAS &x) {
        if(score != x.score) return score > x.score;
        return idx < x.idx;
    }
};

// struct thrust_cmp
// {
//     __host__ __device__
//     bool operator()(const iAS &a, const iAS &b) {
//         // return a < b;
//         if(a.score != b.score) return a.score > b.score;
//         return a.idx < b.idx;
//     }
// };

typedef uint4 group_t; // uint32_t
typedef unsigned long long ull;

#define MAX_DEPTH 24
#define INSERTION_SORT 32

#define CUT_LENGTH 20000
#define STREAM_SIZE 1
#define MAX_DOC_SIZE 128
#define MAX_QUERY_SIZE 128 // 12288
#define MAX_BITMAP_SIZE 1563
#define N_THREADS_IN_ONE_BLOCK 512
#define TOPK 100

#define GUESS_N_DOCS_LEN 8000000
#define GUESS_QUERY_LEN 600
#define stream_lens 2
#define THREAD_SIZE 3
#define BATCH_SIZE 7
#define MAIN_HELP_ME 3200000    // 7853052 11 2000000 1800ms
                                // 7853052 3  2300000 1850ms
                                // 8000000 11 2950000 4.59point
                                
                                // 8000000 3  3000000 5.74points
                                // 8000000 3  3100000 4.94points
                                // 8000000 3  3200000 6.12points
                                
                                // 8000000 1  3200000 5.42points
                                // 8000000 1  3000000 5.30points